Framework EDI Reference. Methods and Properties
ediSecurity. ImportCertificatePfx

Imports certificate(s) and its associated private key from a PFX file.

Syntax:

Parameters:

Returns:

Returns an object of type FREDI.ediSecurityCertificate if imported successfully; otherwise NULL or an empty object is returned if the operation fails.  For PFX files containing multiple certificates, the object returned is the object of the last certificate successfully imported.

Remarks:

The PFX file may contain multiple certificates with their associated private keys (Note. A certificate does not have to have an associated private key).  Each certificate will be imported and stored into the default certificate store, and a new key container with a unique GUID name is created in the CSP database for each associated private key.  If an error is generated while importing multiple certificates, all certificates already imported successfully until the time the error was generated will remain in the certificate store -- that is, the error does not revert the operation back.

The CSP database used is that specified by ProviderName andServiceProviderType.  The type of database, whether machine key set or user key set, is specified using ediDocument.Option by the constant OptDocument_MachineKeySet.

The default certificate store is specified by the properties DefaultCertSystemStoreName and DefaultCertSystemStoreLocation.